﻿@using System.Linq
@model IEnumerable<Citi.HeadCount.WebUI.Models.RuleViewModel>
<script type="text/javascript">
        $(function () {
            if ($("#RuleResultIdParent").val() > 0) {
                $(".hiddenRuleResultId").val($("#RuleResultIdParent").val());
            }
            @{
                if (Model != null && Model.Any())
                {
                <text>$(".hiddenRuleResultId").val(@Model.First().RuleResultId);</text>
                }
            }
        });
</script>
<br />
<table id="tableRules" width="100%">
    <tr>
        <th style="display: none;">
        </th>
        <th>
            Type
        </th>
        <th>
            Level
        </th>
        <th>
            Value
        </th>
        <th  style="display: none;"></th>
    </tr>
    @{
        if (Model != null)
        {
            foreach (var item in Model)
            {
        <tr>
            <td style="display: none;">@item.Id
            </td>
            <td>@item.TypeDescription
            </td>
            <td>@item.Level
            </td>
            <td>@item.Value
            </td>
             <td style="display: none;">@item.Type
            </td>
        </tr>
            }
        }
    }
</table>
